/*
 * @Descripttion: GGB
 * @version: 1.0
 * @Author: GGB
 * @Date: 2021-08-20 07:05:03
 * @LastEditors: GGB
 * @LastEditTime: 2021-08-20 07:25:09
 */
class TeacherAttendanceModel {
  String name;
  String time;
  String avatar;
  String status;

  TeacherAttendanceModel({this.name, this.time, this.avatar, this.status});

  TeacherAttendanceModel.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    time = json['time'];
    avatar = json['avatar'];
    status = json['status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['time'] = this.time;
    data['avatar'] = this.avatar;
    data['status'] = this.status;
    return data;
  }
}

class TeacherPersonAttendanceModel {
  int late;
  int missing;
  int leave;
  Userinfo userinfo;
  int total;
  int personal;
  int sick;
  int trip;
  int other;
  List<Week> week;

  TeacherPersonAttendanceModel(
      {this.late,
      this.missing,
      this.leave,
      this.userinfo,
      this.total,
      this.personal,
      this.sick,
      this.trip,
      this.other,
      this.week});

  TeacherPersonAttendanceModel.fromJson(Map<String, dynamic> json) {
    late = json['late'];
    missing = json['missing'];
    leave = json['leave'];
    userinfo = json['userinfo'] != null
        ? new Userinfo.fromJson(json['userinfo'])
        : null;
    total = json['total'];
    personal = json['personal'];
    sick = json['sick'];
    trip = json['trip'];
    other = json['other'];
    if (json['week'] != null) {
      week = new List<Week>();
      json['week'].forEach((v) {
        week.add(new Week.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['late'] = this.late;
    data['missing'] = this.missing;
    data['leave'] = this.leave;
    if (this.userinfo != null) {
      data['userinfo'] = this.userinfo.toJson();
    }
    data['total'] = this.total;
    data['personal'] = this.personal;
    data['sick'] = this.sick;
    data['trip'] = this.trip;
    data['other'] = this.other;
    if (this.week != null) {
      data['week'] = this.week.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Userinfo {
  String name;
  String avatar;

  Userinfo({this.name, this.avatar});

  Userinfo.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    avatar = json['avatar'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['avatar'] = this.avatar;
    return data;
  }
}

class Week {
  String week;
  int count;

  Week({this.week, this.count});

  Week.fromJson(Map<String, dynamic> json) {
    week = json['week'];
    count = json['count'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['week'] = this.week;
    data['count'] = this.count;
    return data;
  }
}
